//
//  CNEmoButton.swift
//  EmoticonKeyboard
//
//  Created by 陈锦聪 on 16/4/1.
//  Copyright © 2016年 Coco. All rights reserved.
//

import UIKit

class CNEmoButton: UIButton {
    /// 表情模型
    var emoticon: CNEmoticonModel? {
        didSet {
            if let emoji = emoticon?.emoji {
                setTitle(emoji, forState: UIControlState.Normal)
                setImage(nil, forState: UIControlState.Normal)
            } else {
                setTitle(nil, forState: UIControlState.Normal)
                setImage(UIImage(named: emoticon!.pngPath!), forState: UIControlState.Normal)
            }
        }
    }
    
}
